{% for message in messages %}
<div class="messageBlock {% if message.isAdmin %}userMessage{% else %}adminMessage{% endif %}">
    {{ message.message }}

    {% if message.getWebPath() %}
    <ul class="attachments" >
        <li><a href="{{ message.getWebPath() }}"><span class="{% if message.getFileType() == 'pdf' %}icon-pdf{% else %}icon-word{% endif %}"></span>{{ message.attachment }}</a></li>
    </ul>
    {% endif %}

    <span class="arrow"></span>
    <span class="from">
        {% if message.isAdmin %}
        {% trans %}You{% endtrans %}
        {% else %}
        {{ message.user }}
        {% endif %}
    </span>
    <span class="messageDateAndTime">{{ message.createdAt | date('Y-m-d h:i A') }}</span>
</div>
{% endfor %}